<template>
    <div style="margin: 20px;">
        <el-button style="width: 45%" type="primary" size="small" @click.native.prevent="otherLogin('MICROSOFT')">
            oauth2认证
        </el-button>
    </div>
</template>
<script>
    export default {
        name: 'ok',
        data() {
            return {

            }
        },
        created() {

        },
        methods: {
            otherLogin() {
                // 1.先查询clientId

                // 2.拼接授权地址发出请求
                let domain = window.location.protocol + "//" + window.location.host;
                let redirect_uri  = domain + "/callback";
                let url = "http://127.0.0.1:8092/oauth/authorize?client_id=admin-app&response_type=code&scope=all&redirect_uri=" + redirect_uri;
                window.location.href = url;
            }
        }
    }
</script>

<style scoped>

</style>